package com.jprocms.module.cms.enums;

import java.util.Arrays;

/**
 * @author jprocms
 */
public enum EnumSensitiveWordProcessModel {

    //敏感词处理方式(0:不提示直接替换; 1:提示之后替换; 2:不允许提交;3 关闭敏感词)
    REPLACE(0, "不提示直接替换"),
    TIP_REPLACE(1, "提示之后替换"),
    FORBID(2, "不允许提交"),
    CLOSE(3, "关闭敏感词"),
    ;
    private Integer type;
    private String desc;

    EnumSensitiveWordProcessModel(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static EnumSensitiveWordProcessModel getByType(Integer collectType) {
        return Arrays.stream(EnumSensitiveWordProcessModel.values())
                .filter(item -> item.getType().equals(collectType)).findFirst().orElse(null);
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
